Changed __config to react to all of clang's currently documented has_feature flags, and renamed _LIBCPP_MOVE to _LIBCPP_HAS_NO_RVALUE_REFERENCES to be more consistent with the rest of the libc++'s flags, and with clang's nomenclature. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@113086 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/unordered_map b/include/unordered_map index 7513c24..2dd61a5 100644 --- a/include/unordered_map +++ b/include/unordered_map
@@ -375,7 +375,7 @@ __second_constructed(false) {} -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES __hash_map_node_destructor(__hash_node_destructor<allocator_type>&& __x) : __na_(__x.__na_), __first_constructed(__x.__value_constructed), @@ -383,7 +383,7 @@ { __x.__value_constructed = false; } -#else // _LIBCPP_MOVE +#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES __hash_map_node_destructor(const __hash_node_destructor<allocator_type>& __x) : __na_(__x.__na_), __first_constructed(__x.__value_constructed), @@ -391,7 +391,7 @@ { const_cast<bool&>(__x.__value_constructed) = false; } -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES void operator()(pointer __p) { @@ -573,10 +573,10 @@ explicit unordered_map(const allocator_type& __a); unordered_map(const unordered_map& __u); unordered_map(const unordered_map& __u, const allocator_type& __a); -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES unordered_map(unordered_map&& __u); unordered_map(unordered_map&& __u, const allocator_type& __a); -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES unordered_map(initializer_list<value_type> __il); unordered_map(initializer_list<value_type> __il, size_type __n, const hasher& __hf = hasher(), const key_equal& __eql = key_equal()); @@ -585,7 +585,7 @@ const allocator_type& __a); // ~unordered_map() = default; // unordered_map& operator=(const unordered_map& __u) = default; -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES unordered_map& operator=(unordered_map&& __u); #endif unordered_map& operator=(initializer_list<value_type> __il); @@ -604,7 +604,7 @@ const_iterator cbegin() const {return __table_.begin();} const_iterator cend() const {return __table_.end();} -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES pair<iterator, bool> emplace() {return __table_.__emplace_unique();} @@ -613,10 +613,14 @@ pair<iterator, bool> emplace(_A0&& __a0) {return __table_.__emplace_unique(_STD::forward<_A0>(__a0));} +#ifndef _LIBCPP_HAS_NO_VARIADICS + template <class _A0, class... _Args, class = typename enable_if<is_convertible<_A0, key_type>::value>::type> pair<iterator, bool> emplace(_A0&& __a0, _Args&&... __args); +#endif // _LIBCPP_HAS_NO_VARIADICS + iterator emplace_hint(const_iterator) {return __table_.__emplace_unique().first;} @@ -625,28 +629,31 @@ iterator emplace_hint(const_iterator, _A0&& __a0) {return __table_.__emplace_unique(_STD::forward<_A0>(__a0)).first;} +#ifndef _LIBCPP_HAS_NO_VARIADICS + template <class _A0, class... _Args, class = typename enable_if<is_convertible<_A0, key_type>::value>::type> iterator emplace_hint(const_iterator, _A0&& __a0, _Args&&... __args) {return emplace(_STD::forward<_A0>(__a0), _STD::forward<_Args>(__args)...).first;} -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES pair<iterator, bool> insert(const value_type& __x) {return __table_.__insert_unique(__x);} -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _P, class = typename enable_if<is_convertible<_P, value_type>::value>::type> pair<iterator, bool> insert(_P&& __x) {return __table_.__insert_unique(_STD::forward<_P>(__x));} -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES iterator insert(const_iterator, const value_type& __x) {return insert(__x).first;} -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _P, class = typename enable_if<is_convertible<_P, value_type>::value>::type> iterator insert(const_iterator, _P&& __x) {return insert(_STD::forward<_P>(__x)).first;} -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _InputIterator> void insert(_InputIterator __first, _InputIterator __last); void insert(initializer_list<value_type> __il) @@ -674,7 +681,7 @@ {return __table_.__equal_range_unique(__k);} mapped_type& operator[](const key_type& __k); -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES mapped_type& operator[](key_type&& __k); #endif @@ -702,14 +709,16 @@ void reserve(size_type __n) {__table_.reserve(__n);} private: -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_HAS_NO_VARIADICS template <class _A0, class... _Args, class = typename enable_if<is_convertible<_A0, key_type>::value>::type> __node_holder __construct_node(_A0&& __a0, _Args&&... __args); +#endif // _LIBCPP_HAS_NO_VARIADICS template <class _A0, class = typename enable_if<is_convertible<_A0, value_type>::value>::type> __node_holder __construct_node(_A0&& __a0); -#else // _LIBCPP_MOVE +#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES __node_holder __construct_node(const key_type& __k); #endif }; @@ -787,7 +796,7 @@ insert(__u.begin(), __u.end()); } -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> inline @@ -812,7 +821,7 @@ } } -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map( @@ -841,7 +850,7 @@ insert(__il.begin(), __il.end()); } -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> inline @@ -852,7 +861,7 @@ return *this; } -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> inline @@ -864,7 +873,8 @@ return *this; } -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_HAS_NO_VARIADICS template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> template <class _A0, class... _Args, @@ -885,6 +895,8 @@ return __h; } +#endif // _LIBCPP_HAS_NO_VARIADICS + template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> template <class _A0, class // = typename enable_if<is_convertible<_A0, value_type>::value>::type @@ -901,6 +913,8 @@ return __h; } +#ifndef _LIBCPP_HAS_NO_VARIADICS + template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> template <class _A0, class... _Args, class // = typename enable_if<is_convertible<_A0, key_type>::value>::type @@ -916,7 +930,8 @@ return __r; } -#else // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_VARIADICS +#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder @@ -931,7 +946,7 @@ return _STD::move(__h); } -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> template <class _InputIterator> @@ -957,7 +972,7 @@ return __r.first->second; } -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> _Tp& @@ -972,7 +987,7 @@ return __r.first->second; } -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> _Tp& @@ -1104,10 +1119,10 @@ explicit unordered_multimap(const allocator_type& __a); unordered_multimap(const unordered_multimap& __u); unordered_multimap(const unordered_multimap& __u, const allocator_type& __a); -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES unordered_multimap(unordered_multimap&& __u); unordered_multimap(unordered_multimap&& __u, const allocator_type& __a); -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES unordered_multimap(initializer_list<value_type> __il); unordered_multimap(initializer_list<value_type> __il, size_type __n, const hasher& __hf = hasher(), @@ -1117,7 +1132,7 @@ const allocator_type& __a); // ~unordered_multimap() = default; // unordered_multimap& operator=(const unordered_multimap& __u) = default; -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES unordered_multimap& operator=(unordered_multimap&& __u); #endif unordered_multimap& operator=(initializer_list<value_type> __il); @@ -1136,7 +1151,7 @@ const_iterator cbegin() const {return __table_.begin();} const_iterator cend() const {return __table_.end();} -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES iterator emplace() {return __table_.__emplace_multi();} @@ -1145,10 +1160,14 @@ iterator emplace(_A0&& __a0) {return __table_.__emplace_multi(_STD::forward<_A0>(__a0));} +#ifndef _LIBCPP_HAS_NO_VARIADICS + template <class _A0, class... _Args, class = typename enable_if<is_convertible<_A0, key_type>::value>::type> iterator emplace(_A0&& __a0, _Args&&... __args); +#endif // _LIBCPP_HAS_NO_VARIADICS + iterator emplace_hint(const_iterator __p) {return __table_.__emplace_hint_multi(__p.__i_);} @@ -1157,25 +1176,28 @@ iterator emplace_hint(const_iterator __p, _A0&& __a0) {return __table_.__emplace_hint_multi(__p.__i_, _STD::forward<_A0>(__a0));} +#ifndef _LIBCPP_HAS_NO_VARIADICS + template <class _A0, class... _Args, class = typename enable_if<is_convertible<_A0, key_type>::value>::type> iterator emplace_hint(const_iterator __p, _A0&& __a0, _Args&&... __args); -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);} -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _P, class = typename enable_if<is_convertible<_P, value_type>::value>::type> iterator insert(_P&& __x) {return __table_.__insert_multi(_STD::forward<_P>(__x));} -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES iterator insert(const_iterator __p, const value_type& __x) {return __table_.__insert_multi(__p.__i_, __x);} -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _P, class = typename enable_if<is_convertible<_P, value_type>::value>::type> iterator insert(const_iterator __p, _P&& __x) {return __table_.__insert_multi(__p.__i_, _STD::forward<_P>(__x));} -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _InputIterator> void insert(_InputIterator __first, _InputIterator __last); void insert(initializer_list<value_type> __il) @@ -1223,14 +1245,14 @@ void reserve(size_type __n) {__table_.reserve(__n);} private: -#ifdef _LIBCPP_MOVE +#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) template <class _A0, class... _Args, class = typename enable_if<is_convertible<_A0, key_type>::value>::type> __node_holder __construct_node(_A0&& __a0, _Args&&... __args); template <class _A0, class = typename enable_if<is_convertible<_A0, value_type>::value>::type> __node_holder __construct_node(_A0&& __a0); -#endif // _LIBCPP_MOVE +#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) }; template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> @@ -1306,7 +1328,7 @@ insert(__u.begin(), __u.end()); } -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> inline @@ -1333,7 +1355,7 @@ } } -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap( @@ -1362,7 +1384,7 @@ insert(__il.begin(), __il.end()); } -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> inline @@ -1373,7 +1395,7 @@ return *this; } -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> inline @@ -1385,7 +1407,8 @@ return *this; } -#ifdef _LIBCPP_MOVE +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#ifndef _LIBCPP_HAS_NO_VARIADICS template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> template <class _A0, class... _Args, @@ -1406,6 +1429,8 @@ return __h; } +#endif // _LIBCPP_HAS_NO_VARIADICS + template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> template <class _A0, class // = typename enable_if<is_convertible<_A0, value_type>::value>::type @@ -1422,6 +1447,8 @@ return __h; } +#ifndef _LIBCPP_HAS_NO_VARIADICS + template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> template <class _A0, class... _Args, class // = typename enable_if<is_convertible<_A0, key_type>::value>::type @@ -1451,7 +1478,8 @@ return __r; } -#endif // _LIBCPP_MOVE +#endif // _LIBCPP_HAS_NO_VARIADICS +#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> template <class _InputIterator>